package interceptors;

import beans.Usuario;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

public class AutenticacaoInterceptor implements Interceptor{

	public void destroy(){
		
	}
	
	public String intercept(ActionInvocation invocation) throws Exception{
		Usuario usr = (Usuario) invocation.getInvocationContext().getSession().get("usuario");
		if(usr==null)
			return "error";
		return "success";
	}
	
	public void init(){
		
	}
}
